Gets the mouse cursor position relative to GUI window.
GUIGetCursorInfo ( [winhandle] )
Parameters
winhandle | [optional] The handle of the window to use. If omitted the "current" window will be used. |
Return Value
If successful, returns a five-element array that containing the mouse cursor information:
Remarks
The coordinates given are relative to the GUI window (known as client coords).
Related
GUICreate, GUIGetMsg
Example
#include <GUIConstants.au3>
$IDC = 0
HotkeySet("{Esc}", "GetPos")
GUICreate("Press Esc to Get Pos", 400, 400)
$x=GUICtrlCreateLabel ("0", 10, 10,50)
$y=GUICtrlCreateLabel ("0", 10, 30,50)
GUISetState()
; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE
Exit
Func GetPos()
$a=GUIGetCursorInfo()
GUIctrlSetData($x,$a[0])
GUIctrlSetData($y,$a[1])
EndFunc